package codeMonkeyClock;

import processing.core.*;

/**
 *  CodeMonkeyClock_text - test class
 *  Copyright (C) 2013  Samantha Lycett
 *  
 *  This file is part of CodeMonkeyClock.
 *
 *  CodeMonkeyClock is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  any later version.
 *
 *  CodeMonkeyClock is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with CodeMonkeyClock.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * CodeMonkeyClock displays the system time + a random amount fast, upto 15 minutes
 * this class is for testing the simple idea (no clock face)
 * 
 * @author Samantha Lycett
 * @created 13 June 2013
 */
public class CodeMonkeyClock_text extends PApplet  {

	/**
	 * 
	 */
	private static final long serialVersionUID = 5181865354020498924L;
	
	Clock thisClock 	= Clock.getClock();
	PFont clockFont 	= createFont("Arial",16,true);
	
	
	public void setup() {
		size(200,200);
		frameRate(1);
		
	}
	
	public void draw() {
		
		background(255);
		
		float minD = height;
		if (width < height) minD = width;
		float fs = 18*minD/200;
		textFont(clockFont,fs);                 // font size scales as window size
		
		fill(0);                        		// Specify font color (black)
		
		thisClock.tick();						// increment the clock
		
		text("Real time", 						5*width/100, 	1*height/3 );  				
		text(thisClock.getRealTime_hhmmss(), 	60*width/100,	1*height/3 );					
		text("Monkey time",						5*width/100, 	2*height/3 );  									
		text(thisClock.getMonkeyTime_hhmmss(),	60*width/100,	2*height/3 );	
	}
	
	///////////////////////////////////////////////////////////////////////////////////////////////
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		System.out.println("** CodeMonkeyClock_text **");
		PApplet.main(new String[] { "--present", "codeMonkeyClock.CodeMonkeyClock_text" });
		System.out.println("** END **");
		
	}
}
